GBML manual / Rooms

room_height

The current room’s height, in pixels.

Syntax

room_height() -> int

Returns

int

Description

The current room's height, in pixels - the vertical counterpart to room_width, for exactly the same reasons: a bounds calculation, a spawn position, anything that should track the room's actual size rather than a hard-coded number.

Positions in a room count from its top-left corner, and y counts down, so room_height() is also the y of the room's bottom edge, and room_height() / 2 is the y of the room's middle.

Example

var h = room_height();

Reads the active room's height into a local variable.

See also: room_width